﻿using System;
using System.Collections.Generic;
using System.Net;
using JetBlack.FeedBus.Adapters;

namespace ExamplePublisher
{
    class Program
    {
        static void Main(string[] args)
        {
            Client client = new Client();

            // Attempt to connect.
            try
            {
                client.Connect(Dns.GetHostName(), 9123);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Failed to connect to distributor: {0}", ex.Message);
                Environment.Exit(-1);
            }

            Dictionary<string, object> data = new Dictionary<string, object>();
            data["age"] = 21;
            data["name"] = "Rob";

            client.Publish("LSE", "FOO", true, data);

            client.Close();
        }
    }
}
